
Ext.define('Intranet.Desktop.controller.MainScreen', {
    extend: 'Ext.app.Controller',
    views: [
        'Intranet.Desktop.view.MainScreen',
        'Intranet.Desktop.view.CompanyPanel',
        'Intranet.Desktop.view.TeamGroupsView',
        'Intranet.Desktop.view.PersonalView',
        'Intranet.Desktop.view.Toolbox',
        'Intranet.Desktop.view.ToolboxWindow'
    ],
    init: function() {
        this.control({
            'container button[id=toolboxBtn]': {
                click: this.showToolboxWindow

            }

        });
    },
    showToolboxWindow: function() {

        var toolboxWin = Ext.WindowManager.get('toolboxWindow');

        if (!toolboxWin)
        {
            toolboxWin = Ext.widget('toolboxWindow');
        }

        if (toolboxWin.isHidden())
        {
            toolboxWin.show();
            toolboxWin.alignTo('toolboxBtn', 'bl-tl', [2, -5]);
        }
        else
        {
            toolboxWin.hide();
        }




    }

});

